<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
	<script>
		let arr = ['1','20','-5','3'];
		console.log(arr);
		/*let newArr = arr.map(function (item) {
			return parseInt(item);
		})*/
		let newArr = arr.map(item => parseInt(item));
		console.log(newArr);

		let arr1 = [1,20,-5,3];
		let result1 = arr1.reduce(function (a, b) {
			//1 20
			//21 -5
			//16 3
			console.log(a, b)
			return a + b
		})
		console.log(result1)

		let result2 = arr1.reduce((a, b) => a + b)
		console.log(result2)

		let result3 = arr1.reduce(function (a, b) {
			console.log(a, b);
			return a * b;
		});
		console.log(result3);

		let result4 = arr1.reduce((a, b) => a * b);
		console.log(result4);
		console.log('--------------')
		let result5 = arr1.reduce(function (a, b) {
			//0 1
			//0 20
			//0 -5
			console.log(a, b)
			return a * b
		}, 0)
		console.log(result5)
		let result6 = arr1.reduce((a, b) => a + b, 0)
	</script>
</head>
<body>

</body>
</html>